import {instance} from '@/http/instance';

const createForm = (eventId) => {
    return instance({
        url: `/event/${eventId}/form`,
        method: 'post',
    });
};
const updateForm = (data) =>{
    return instance({
        url: '/form',
        method: 'put',
        headers: {
            'Content-Type': 'application/json',
        },
        data,
    });
};
const deleteForm = (formId)=>{
    return instance({
        url: `/form/${formId}`,
        method: 'delete',
    });
};
const getForm = (formId)=>{
    return instance({
        url: `/form/${formId}`,
        method: 'get',
    });
};
const getFileList = (formId) => {
    return instance({
        url: `/form/file?formId=${formId}`,
        method: 'get',
    });
};
const deleteFile = (data) => {
    return instance({
        url: '/form/file',
        method: 'delete',
        data,
    });
};
export default {
    createForm,
    updateForm,
    deleteForm,
    getForm,
    getFileList,
    deleteFile,
};
